/**
 * Created by Administrator on 2017/4/25.
 */
$(document).ready(function () {
    var downElement;
    $(document).mousedown(function (e) {
        downElement = e.target;
    });

    $(document).mouseup(function (e) {
        var downElemnt = $(downElement);
        var upElement = $(e.target);
        if (downElemnt.parent() == upElement) {
            $('p').addClass('hidden');
        } else if (downElemnt.children().first() == upElement) {
            $('p').removeClass('hidden');
        }
    });
});